package com.fy.order.api;

import com.fy.order.dto.FindOrderDto;
import com.fy.order.dto.ObjectOrderDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@Primary
@FeignClient(value = "domain-order", path = "/product/order")
public interface ProductOrderService {

    //添加object_order实物订单信息
    @RequestMapping(value = "/addProductOrder",method = RequestMethod.POST)
    ObjectOrderDto addProductOrder(ObjectOrderDto objectOrderDto);

    //通过id查看object_order订单
    @GetMapping(value = "/objectOrderFindById")
    ObjectOrderDto objectOrderFindById(int objectOrderId);

    //查看全部object_order订单
    @GetMapping(value = "/objectOrderFindAll")
    List<ObjectOrderDto> objectOrderFindAll();

    //查询订单条件查
    @GetMapping(value = "/findObjectOrder")
    ObjectOrderDto findObjectOrder(FindOrderDto findOrderDto);

    //修改object_order订单信息
    @RequestMapping(value = "/updateObjectOrder",method = RequestMethod.POST)
    Boolean updateObjectOrder(@RequestBody ObjectOrderDto objectOrderDto);

    //修改object_order订单状态
    @RequestMapping(value = "/updateObjectOrderState",method = RequestMethod.POST)
    ObjectOrderDto updateObjectOrderState(int objectOrderId, int orderState);

    //删除object_order订单
    @RequestMapping(value = "/deleteObjectOrderState",method = RequestMethod.POST)
    int deleteObjectOrderState(int objectOrderId);

    //支付
    @RequestMapping(value = "/payObjectOrderState",method = RequestMethod.POST)
    ObjectOrderDto payObjectOrderState(int objectOrderId);

    //发货
    @RequestMapping(value = "/deliveryUpdateObjectOrder",method = RequestMethod.POST)
    ObjectOrderDto deliveryUpdateObjectOrder(int objectOrderId, int orderDeliverNumber);

}
